package ui.face
{

	import flash.display.Sprite;
	import flash.utils.Dictionary;

	/**
	 * 主UI左边的快捷链接。
	 */
	public class QuickBarFace extends Sprite
	{
		private var _items:Array;

		public function QuickBarFace()
		{
			_items = [];
			var item:QuickBarItem;
			item = new QuickBarItem("quick_train");
			item.x = 0;
			item.y = 0;
			this.addChild(item);
			_items[0] = item;

			item = new QuickBarItem("quick_strong");
			item.x = 0;
			item.y = 32;
			addChild(item);
			_items[1] = item;
			//TODO测试
			_items[0].update("训练 5/5");
			_items[1].update("武器需要强化");
		}

		public function update():void
		{

		}
	}
}

import flash.display.Bitmap;
import flash.display.Sprite;

import globals.Global;

import ui.component.Label;

class QuickBarItem extends Sprite
{

	private var icon:Bitmap;
	private var label:Label;

	public function QuickBarItem(iconUrl:String)
	{
		icon = new Bitmap(Global.assetsManager.getAssetsAsBitmapData(iconUrl));
		icon.x = 12 - icon.width * 0.5;
		icon.y = 12 - icon.height * 0.5;
		this.addChild(icon);

		label = new Label(12, 0xFFFFFF, false, "left", true);
		label.x = 30;
		label.y = 2;
		this.addChild(label);
	}

	public function update(text:String):void
	{
		label.text = text;
	}
}